package org.aurora.model.response;

import org.aurora.remote.protocol.RemoteResponse;

import java.io.Serializable;

public class CommonResponse extends RemoteResponse implements Serializable {
    private CommonResponse() {
    }

    public static CommonResponse buildSuccess() {
        CommonResponse commonResponse = new CommonResponse();
        commonResponse.setSuccess(true);
        return commonResponse;
    }

    public static CommonResponse buildFail(String errorMsg) {
        CommonResponse commonResponse = new CommonResponse();
        commonResponse.setSuccess(false);
        commonResponse.setErrorMsg(errorMsg);
        return commonResponse;
    }

    private String errorMsg;

    private boolean success = true;

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }
}
